from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import re
import time

options = Options()
options.add_argument('--headless')
driver = webdriver.Chrome('chromedriver',options=options)
url = 'http://ny.gxhuifeng.cn/q/?c=11512421503100066682031575944580'
driver.get(url)
time.sleep(0.28)
page_source = driver.page_source
hot_soup = re.sub(r'<.*?>','\n',str(page_source))
hot_soup = hot_soup.replace(':','\n').replace('：','\n').replace(' ','\n').replace('\t','\n')
message = re.findall(r'.+',hot_soup)
print(message)
specs_list = ['商品规格','产品规格','规格','净含量','规格名称']
for i in specs_list:
    try:
        specs = message.index(i)+1
    except:
        continue
    else:
        print(message[specs])
        break